package work.parabola.keyboardswitch.pojo.query.keyboard;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import work.parabola.keyboardswitch.common.ResponseCode;
import work.parabola.keyboardswitch.common.ServerResponse;

@Data
@ToString
@EqualsAndHashCode
public class KeyboardChooseSwitchQuery {

    private Integer cellId;

    private Integer switchId;

    public ServerResponse validate() {
        if (cellId == null || switchId == null) {
            return ServerResponse.createByErrorCodeMessage(ResponseCode.ILLEGAL_ARGUMENT.getCode(),
                    ResponseCode.ILLEGAL_ARGUMENT.getDesc());
        }
        return ServerResponse.createBySuccess();
    }
}
